package org.yiqixue.accounts.dto;

import lombok.Data;
import org.yiqixue.accounts.entity.TransactionStatus;
import org.yiqixue.accounts.entity.TransactionType;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 交易数据传输对象
 * 用于API接口的数据传输
 */
@Data
public class TransactionDTO {
    private Long transactionId;
    private String accountNumber;
    private BigDecimal amount;
    private LocalDateTime transactionDate;
    private String description;
    private TransactionStatus status;
    private TransactionType type;
    
    // 用于创建新交易的构造函数
    public TransactionDTO(String accountNumber, BigDecimal amount, String description, TransactionType type) {
        this.accountNumber = accountNumber;
        this.amount = amount;
        this.description = description;
        this.type = type;
        this.transactionDate = LocalDateTime.now();
        this.status = TransactionStatus.PENDING;
    }
    
    // 无参构造函数
    public TransactionDTO() {
    }
} 